/*
 * @Author: Joel
 * @Date: 2025-04-10 08:45:30
 * @LastEditors: Joel
 * @LastEditTime: 2025-04-17 10:31:25
 * @FilePath: /gd32f303cct6/usr/board_driver/rled.h
 * @Description: 
 * Copyright (C) 2025 YiJiaLink, All Rights Reserved. 
 * 2025-04-10 08:45:30
 */

 #ifndef __RLED_H
 #define __RLED_H
 
 /* 包含头文件代码 */
 
 #include <stdio.h>
 #include <stdint.h>
 #include <string.h>

#include "gd32f30x.h"

 #if defined(__cplusplus)
 extern "C" {
 #endif /*_cplusplus*/


 /*RLED 硬件连接 */
 #define RLED_GPIO_CLK                    RCU_GPIOB
 #define RLED_GPIO_PORT                   GPIOB
 #define RLED_PIN                         GPIO_PIN_0

 /* pwm_duty 0 - 25 - 50 - 75 - 100 */
enum PWM_DUTY
{
    DUTY0 = 100,
    DUTY25 = 25,
    DUTY50 = 50,
    DUTY75 = 75,
    DUTY100 = 0
};

/* 功能打包 */
struct rled_func
{
    /* data */
    void (*init_rled)(void);
    void (*run_rled)(enum PWM_DUTY PWM_DUTY);
    void (*stop_rled)(void);
};

struct rled_func *rled_init(void);


 #if defined(__cplusplus)
}
#endif /*_cplusplus*/

#endif
/* el psy congroo */